/*
 *  intrp.h
 *  Fib
 *
 *  Created by John Bassham on 11/13/08.
 *  Copyright 2008 __MyCompanyName__. All rights reserved.
 *
 */

#ifndef INTRP_H_
#define INTRP_H_

#include <stdio.h>
#include <time.h>

#include "bool.h"
#include "mod.h"

#define MAX_MOD_FILES	255

struct intrp_ops {
	const char *return_type_str;
	bool is_interactive;
	bool only_check_syntax;
	FILE *mod_files[MAX_MOD_FILES];
	int mod_files_cnt;
	int primary_mod_indx;
};

struct intrp {
	bool has_init_errors;
	const char *return_type_str;
	bool is_interactive;
	bool only_check_syntax;
	
	struct mod *usr_mods;
	int usr_mods_cnt;
	struct mod *sys_mods;
	int sys_mods_cnt;
	struct mod *syn_mods;
	int syn_mods_cnt;
	int primary_usr_mod_indx;
	time_t time_created;
};

bool init_intrp(struct intrp *, const struct intrp_ops *);

bool is_intrp_ready(const struct intrp *);

const char *get_intrp_return_type(const struct intrp *);

void *intrp_run(struct intrp *);

#endif
